//
//  HTTPURL.h
//  QiXingIos
//
//  Created by 李雪虎 on 2016/11/15.
//  Copyright © 2016年 王旭阳. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
#import <MJExtension/MJExtension.h>
#import <MJRefresh/MJRefresh.h>

@interface HTTPURL : NSObject

+(void)postRequest:(NSString *)url
        parameters:(id)parameter
           success:(void (^)(NSURLSessionDataTask *task, NSDictionary *  responseObject))ltSuccess
            filure:(void (^)(NSURLSessionDataTask *  task, NSError *  error))ltFailure;
+(void)deleteRequest:(NSString *)url
        parameters:(id)parameter
           success:(void (^)(NSURLSessionDataTask *task, NSDictionary *  responseObject))ltSuccess
              filure:(void (^)(NSURLSessionDataTask *  task, NSError *  error))ltFailure;

+(void)postRequest5s:(NSString *)url
          parameters:(id)parameter
             success:(void (^)(NSURLSessionDataTask *  task, id   responseObject))ltSuccess
            filure:(void (^)(NSURLSessionDataTask *  task, id   error))ltFailure;

+(void)getRequest:(NSString *)url
       parameters:(id)parameter
          success:(void (^)(NSURLSessionDataTask *  task, id   responseObject))ltSuccess
           filure:(void (^)(NSURLSessionDataTask *  task, id   error))ltFailure;

+(void)getUrlRequest:(NSString *)url
          parameters:(id)parameter
             success:(void (^)(NSURLSessionDataTask *  task, id   responseObject))ltSuccess
           filure:(void (^)(NSURLSessionDataTask *  task, id   error))ltFailure;

+(void)getjsonRequest:(NSString *)url
           parameters:(id)parameter
              success:(void (^)(NSURLSessionDataTask *  task, id   responseObject))ltSuccess
               filure:(void (^)(NSURLSessionDataTask *  task, id   error))ltFailure;


+(void)uploadImageWithPath:(NSString* )path
                    params:(NSDictionary* )params
                       img:(UIImage* )img
                   success:(void (^)(NSURLSessionDataTask *task, NSDictionary* successUrl))successBlock
                   failure:(void (^)(NSURLSessionDataTask *  task, NSError* ))failtureBlock;

+(void)uploadFileWithPath:(NSString* )path
                 fileName:(NSString *)fileName
                    params:(NSDictionary* )params
                       data:(NSData* )data
                   success:(void (^)(NSURLSessionDataTask *task, NSDictionary* successUrl))successBlock
                   failure:(void (^)(NSURLSessionDataTask * task, NSError* ))failtureBlock;
//提示框(两个按钮的)
+(UIAlertController *)showTwoAlertWithTitle:(NSString *)title
                                    message:( NSString *)message
                             preferredStyle:(UIAlertControllerStyle)preferredStyle
                                  sureTitle:(NSString *)sureTitle
                                cancelTitle:(NSString *)cancelTitle
                                  sureBlock:(void(^)(void))sureBlock
                                cancelBlock:(void(^)(void))cancelBlock;

//提示框(一个按钮的)
+(UIAlertController *)showOneAlertWithTitle:(NSString *)title
                                    message:( NSString *)message
                             preferredStyle:(UIAlertControllerStyle)preferredStyle
                                  sureTitle:(NSString *)sureTitle
                                  sureBlock:(void(^)(void))sureBlock;


//设置下拉动画文字
+(void)MJheaderDH:(MJRefreshGifHeader *)header;
+(void)MJfoodDH:(MJRefreshAutoGifFooter *)footer;
+(NSString *)compareCurrentTime:(NSString*)string;//时间转换
+(void)promptViewmessage:(NSString *)message VC:(UIViewController*)VC sureBlock:(void(^)(void))sureBlock;

+ (BOOL)reachabilityConnection;
@end
